/*---------------------------------------------------------------------------------------------
 *  Copyright (c) kylinIDETeam. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

import { localize } from 'vs/nls';
import { MenuRegistry, MenuId, registerAction2, Action2 } from 'vs/platform/actions/common/actions';
import { IWorkbenchDeployService } from 'vs/workbench/services/issue/common/deploy';
import { Categories } from 'vs/platform/action/common/actionCommonCategories';
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import product from 'vs/platform/product/common/product';
//#region Commands

class deployWindow extends Action2 {

	static readonly ID = 'workbench.action.deployWindow';
	static readonly AVAILABLE = !!product.deployFunc;
	constructor() {
		super({
			id: deployWindow.ID,
			title: {
				value: localize('deployWindow', "打开开发环境快速部署"),
				mnemonicTitle: localize({ key: 'mideployWindow', comment: ['&& denotes a mnemonic'] }, "打开开发环境快速部署"),
				original: 'DeployWindow'
			},
			category: Categories.Help,
			f1: true
		});
	}

	override async run(accessor: ServicesAccessor): Promise<void> {
		const deployService = accessor.get(IWorkbenchDeployService);
		return deployService.openDeployWindow(false);

	}
}
if (deployWindow.AVAILABLE) {
	registerAction2(deployWindow);
	MenuRegistry.appendMenuItem(MenuId.MenubarHelpMenu, {
		group: '2_reference',
		command: {
			id: deployWindow.ID,
			title: localize({ key: 'mideployWindow', comment: ['&& denotes a mnemonic'] }, "打开开发环境快速部署")
		},
		order: 6
	});
}


//#endregion
